<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>显示所有用户</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <css file="__PUBLIC__/css/base.css"/>
	<jquery />
	<script src="__DATA__/validate.min.js" language="javascript"></script>
	<head>
<body>
<div class='now_path'>
		<strong>您现在的位置是:</strong>
		会员管理>添加会员组
</div>
	<fieldset class='field_tishi'>
		<legend>操作提示</legend>
		1：用户名由1-30位中文，数字，字母，下划线组成 ；2：密码由3-20位之间的数字，字母，下划线组成 
	</fieldset>
	<form action='__WEB__/admin/member/add_member_exe' method='post' name='member'>
	<div class="success_box">所有的选项都填写正确</div>
	<div class="error_box"></div>
    <table class='table3'>
    	<tr>
    		<th colspan='2' style='text-align:center; font-size:16px;'>添加用户</th>
    	</tr>
    	<tr>
    		<th>会员名称</th>
			<td><input type='text' name='username' /><span class='desc'>会员名称必填</span></td>
    	</tr>
		<tr>
    		<th>会员密码</th>
			<td><input type='text' name='password' /><span class='desc'>密码必填，至少六位</span></td>
    	</tr>
		<tr>
    		<th>会员邮箱</th>
			<td><input type='text' name='email' /><span class='desc'>邮箱必填</span></td>
    	</tr>
		<tr>
    		<th>昵称</th>
			<td><input type='text' name='nickname' /></td>
    	</tr>
		<tr>
    		<th>性别</th>
			<td><input type='radio' name='sex' value='1' />男
				<input type='radio' name='sex' value='2' />女
			</td>
    	</tr>
		<tr>
    		<th>qq</th>
			<td><input type='text' name='qq' /></td>
    	</tr>
		<tr>
    		<th>手机</th>
			<td><input type='text' name='mobile' /></td>
    	</tr>
		<tr>
    		<th>会员组</th>
			<td>
				<select name='user_role[rid]'>
					<option value=''>==请选择用户组==</option>
					<foreach from='$roles' value='$v'>
						<option value='{$v.rid}'>{$v.rname}({$v.title})</option>
					</foreach>
					
					
				</select>
			</td>
    	</tr>
		<tr>
    		<th>是否启用</th>
			<td><input type='radio' name='status' value='1' checked='checked'/>启用
				<input type='radio' name='status' value='0' />停止
			</td>
    	</tr>
		<tr>
			
    		<td colspan='2' class='sub'><input type='submit' class='button4' value='增加'  name='submit'/></td>
    	</tr>
    </table>
</form>
<script type='text/javascript'>
		var validator = new FormValidator('member', [{
		    name: 'username',
		    display: '会员名称',    
		    rules: 'required'
		},{
    		name: 'password',
			display: '会员密码',
    		rules: 'required|min_length[6]|alpha_dash'
		},{
			name:'email',
			display:'邮箱填写',
			rules:'required|valid_email'
		},{
			name:'sex',
			display:'性别',
			rules:'required'
		}], function(errors, event) {
		    var SELECTOR_ERRORS = $('.error_box'),
		        SELECTOR_SUCCESS = $('.success_box');
			    if (errors.length > 0) {
			        SELECTOR_ERRORS.empty();
			        for (var i = 0, errorLength = errors.length; i < errorLength; i++) {
			            SELECTOR_ERRORS.append(errors[i].message + '<br />');
			        }
			        SELECTOR_SUCCESS.css({ display: 'none' });
			        SELECTOR_ERRORS.fadeIn(200);
					return false;
			    } else {
			        SELECTOR_ERRORS.css({ display: 'none' });
			        SELECTOR_SUCCESS.fadeIn(200);
					return true;
			    }
		});
	</script>
</body>
</html>
